object averageOfListBelowN{
	def main(list: List[Int], n: Int){
		val filteredList = list.filter(_ < n)
		if (filteredList.isEmpty) {
			println(0)
		} else {
			println(filteredList.sum.toDouble / filteredList.length.toDouble)
		}
	}
}
averageOfListBelowN.main(List(1,2,3,4,5,6,7,8,9),6)
